{extends file="./main.tpl"}
{block name=head}
<link href="css/user.css" rel="stylesheet" type="text/css" />
<script src="./js/jquery.min.js"></script>
<script type=text/javascript>
function getStageOfContract()
{
	var dataString = "userId=" + $("#userId").val();
	if($("#userId").val() > 0 && $("#userId").val() != '')
	{
	  $.ajax({
		  type: "GET",
		  url: "getStageOfContract.php",
		  data: dataString,
		  success:function(data){
		    $("#invoiceId").html(data);  	
		  }
	  });
  }
}
</script>
{/block}
{block name="body"}
<form action="stageProcess.php" method="POST" class="register" > 
  <table align="center">
  	<tr>
      <th>USER : </th>
      <td class="text-field"><label>
        <select name="userId" id="userId" onchange="getStageOfContract();">
          <option value="">Select</option>
          	{html_options values=$userArray.userId output=$userArray.company}
        </select></label>
      </td>
    </tr>
    <h1 align="center" style="font-size:px; color:#5BA7E9;">STAGE OF PROCESS</h1>
    <tr id="invoiceId">
			<th>Invoice No:</th>
			 <td class="text-field"><label>
			   <select>
			     <option value="">Select</option>
			   </select></label>
			 </td>    	
    </tr>
    <th>STAGE OF PROCESS :</th>
    <td class="text-field"><label>
      <select name="stageProcessId" >
        <option value="">Select</option>
        {html_options values=$processArray.stageProcessId output=$processArray.stageProcessName}
      </select></label>
    </td>
    <tr>
      <td colspan="3" align="center"><input type="submit" name="submit" value="Submit" class="button" onClick="ValidateForm(this.form)"></td>
    </tr>
  </table>
</form>
<form class="register" action="stageProcess.php" method="post">
<table align="center">
  <h1 align="center" style="font-size:28px; color:#5BA7E9;">STAGE OF PROCESS LIST</h1>
  <tr>
    <td class="text-field">Invoice No</td>
    <td class="text-field">Stage Of Process</td>
    <td class="text-field">Status</td>
    <td class="text-field">User</td>
    <td class="text-field">Check</td>
  </tr>
  {section name=sec loop=$processArrayList}
  <tr>
	  <td class="text-field">{$processArrayList[sec].invoiceNo}</td>
	  <td class="text-field">{$processArrayList[sec].stageProcessName}</td>
	  <td class="text-field">{$processArrayList[sec].action}</td>
	  <td class="text-field">{$processArrayList[sec].company}</td>
	  <td class="text-field"><input type="checkbox" name="checkedStageIds[]" value="{$processArrayList[sec].stagecontractId}" /></td>
  </tr>
  {/section}
  </table>
  <input type="submit" name="submitCheck" value="Submit" class="button"></td>
</form>
{/block}